﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AgentQltySvrActList.aspx.cs" Inherits="IHISCETeim.Web.AgentSys.SvrMgr.AgentQltySvrActList" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>品情汇总</title>
</head>
<body>
    <form id="form1" runat="server">
        <f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
        <f:Panel ID="Panel1" runat="server" BodyPadding="2px"  
            ShowBorder="false" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start"
            ShowHeader="false">
            <Items>
                <f:Form ID="Form2" runat="server"  BodyPadding="2px 1px" ShowHeader="false"
                    ShowBorder="false" LabelAlign="Right" >
                    <Rows>
                        <f:FormRow ID="FormRow1" runat="server">
                            <Items>
                                <f:TwinTriggerBox ID="ttbSearchMessage" runat="server" ShowLabel="true" Label="查找条件" EmptyText="输入品情号/机号/机型/用户 进行搜索"
                                    Trigger1Icon="Clear" Trigger2Icon="Search" ShowTrigger1="false" OnTrigger2Click="ttbSearchMessage_Trigger2Click"
                                    OnTrigger1Click="ttbSearchMessage_Trigger1Click">
                                </f:TwinTriggerBox>
                                <f:RadioButtonList ID="rblSearchSvrAct" AutoPostBack="true" OnSelectedIndexChanged="rblSearchSvrAct_SelectedIndexChanged"
                                    Label="服务担当" ColumnNumber="3" runat="server">
                                    <f:RadioItem Text="全部"  Value="all" Selected="true"/>
                                    <f:RadioItem Text="只是我" Value="my" />
                                </f:RadioButtonList>  
                                <f:HiddenField runat="server" ID="IsYJGL" AutoPostBack="true" Text=""> </f:HiddenField>   
                                <f:HiddenField runat="server" ID="NoNormative" AutoPostBack="true" Text=""> </f:HiddenField>                          
                            </Items>
                        </f:FormRow>
                         <f:FormRow>
                            <Items>
                                 <f:Panel runat="server"  ShowHeader="false" ShowBorder="false" Layout="HBox" >
                                    <Items>
                                    <f:TextBox ID="tbxAgentName" runat="server" Label="经销商"></f:TextBox>
                                    <f:TextBox ID="tbxSvrName" runat="server" Label="服务担当"></f:TextBox>
                                    </Items>
                                </f:Panel>
                                 <f:Panel runat="server"  ShowHeader="false" ShowBorder="false" Layout="HBox" >
                                    <Items>
                                        <f:DatePicker runat="server" ID="FromPartsInDate" Label="品情确认时间从"></f:DatePicker>
                                        <f:DatePicker runat="server" ID="ToPartsInDate" Label="到"></f:DatePicker>                                        
                                    </Items>
                                </f:Panel>
                            </Items>
                        </f:FormRow>
                        <f:FormRow>
                            <Items>
                                <f:Panel runat="server"  ShowHeader="false" ShowBorder="false" Layout="HBox" >
                                    <Items>
                                        <f:DatePicker runat="server" ID="FromIssueDate" Label="发行日期从"></f:DatePicker>
                                        <f:DatePicker runat="server" ID="ToIssueDate" Label="到"></f:DatePicker>                                        
                                    </Items>
                                </f:Panel>
                                <f:Panel runat="server"  ShowHeader="false" ShowBorder="false" Layout="HBox" >
                                    <Items>
                                        <f:TextBox runat="server" ID="FromClaimsNumber" Label="品情号从"></f:TextBox>
                                        <f:TextBox runat="server" ID="ToClaimsNumber" Label="到"></f:TextBox>       
                                        <f:Button ID="btnSearch" Icon="SystemSearch" runat="server" Text="确定" OnClick="btnSearch_Click"></f:Button>                                 
                                    </Items>
                                </f:Panel>
                               
                            </Items>
                        </f:FormRow>
                    </Rows>
                </f:Form>
                <f:Grid ID="Grid1" runat="server" BoxFlex="1" ShowBorder="true" ShowHeader="false"
                    EnableCheckBoxSelect="false"  EnableColumnLines="true" 
                    DataKeyNames="QltyId" AllowSorting="true" OnSort="Grid1_Sort"  SortField="ClaimState"
                    SortDirection="ASC" AllowPaging="true" IsDatabasePaging="true" OnPageIndexChange="Grid1_PageIndexChange" OnRowDataBound="Grid1_RowDataBound" OnRowCommand="Grid1_RowCommand" OnPreRowDataBound="Grid1_PreRowDataBound" >
                    <Toolbars>
                        <f:Toolbar ID="Toolbar1" runat="server">
                            <Items>
                                <f:Button ID="btnNew" runat="server" Icon="Add" EnablePostBack="false" Text="填写品情" OnClientClick="openAddAgentQlty();" Hidden="true"></f:Button>
                                <f:Button ID="btnRefre" Icon="SystemSearch" runat="server" Text="刷新" OnClick="btnSearch_Click"></f:Button> 
                                <f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>    
                                <f:Button ID="btnBatchExecl" runat="server" Icon="PageExcel" EnablePostBack="true" Text="批量导出品情" OnClick="btnBatchExecl_Click" ></f:Button>
                                <f:Button ID="btnExecl" runat="server" Icon="PageExcel" EnablePostBack="true" Text="导出品情列表" OnClick="btnExecl_Click" ></f:Button>
                            </Items>
                        </f:Toolbar>
                    </Toolbars>
                    <PageItems>
                        <f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
                        </f:ToolbarSeparator>
                        <f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数：">
                        </f:ToolbarText>
                        <f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged"
                            runat="server">
                            <f:ListItem Text="10" Value="10" />
                            <f:ListItem Text="20" Value="20" />
                            <f:ListItem Text="50" Value="50" />
                            <f:ListItem Text="100" Value="100" />   
                        </f:DropDownList>
                    </PageItems>
                    <Columns>
                        <f:RowNumberField Width="30px" EnablePagingNumber="true" TextAlign="Center" /> 
                        <f:TemplateField HeaderText="品情状态"  Width="100px" SortField="ClaimState">
                            <ItemTemplate>
                                <asp:HyperLink ID="hlClaimState" runat="server" NavigateUrl="javascript:return false" Text='<%# Eval("ClaimState") %>' ToolTip=""></asp:HyperLink>
                            </ItemTemplate>
                        </f:TemplateField>
                        <f:BoundField Width="90px" HeaderText="服务担当"  DataField="SrvActRealName" />
                         <f:BoundField DataField="AgentName" SortField="AgentName" Width="100px" HeaderText="经销商" />
                        <f:LinkButtonField ColumnID="showSvrSchem" TextAlign="Center"  Width="85px" HeaderText="" Enabled="false" />
                        <f:TemplateField HeaderText="品情号"  Width="95px" SortField="ClaimsNumber" >
                            <ItemTemplate>
                                <asp:HyperLink ID="openClaims" runat="server" NavigateUrl="" Text='<%# Eval("ClaimsNumber") %>' ToolTip="打开品情"></asp:HyperLink>
                            </ItemTemplate>
                        </f:TemplateField>                               
                        <f:BoundField DataField="IssueDate" SortField="IssueDate" Width="130px" HeaderText="发行日期" DataFormatString="{0:yyyy-MM-dd HH:mm}" />                       
                        <f:LinkButtonField ColumnID="selectSerialNumber" TextAlign="Center" Icon="SystemSearch"  DataTextField="SerialNumber"  ToolTip="查看故障历史"  CommandName="selectSerialNumber" Width="120px" HeaderText="机号" />
                        <f:BoundField DataField="MachineType" SortField="MachineType" Width="80px" HeaderText="机型" Hidden="true" /> 
                        <f:BoundField DataField="CustomerName" SortField="CustomerName" HeaderText="用户" Width="80px" /> 
                        <f:BoundField DataField="FaultDate" SortField="FaultDate" DataFormatString="{0:yyyy-MM-dd HH:mm}" HeaderText="故障日" NullDisplayText="" Width="130px" />  
                        <f:BoundField DataField="WorkHour"  SortField="WorkHour" HeaderText="工作小时" NullDisplayText="0" Width="80px" />      
                       <%-- <f:BoundField DataField="ReportUser"  SortField="ReportUser" HeaderText="报告人" NullDisplayText=""  />
                        <f:BoundField DataField="ReportTel"  SortField="ReportTel" HeaderText="联系电话" NullDisplayText=""  />--%>
                        
                                               
                        <f:BoundField DataField="PartsRequestType_Show"  SortField="PartsRequestType_Show" HeaderText="配件需求情况" NullDisplayText="" Width="180px"/>
                         <f:BoundField DataField="NoticeSendPartsDate" SortField="NoticeSendPartsDate" DataFormatString="{0:yyyy-MM-dd HH:mm}" HeaderText="品情确认时间" NullDisplayText="" Width="130px" />
                         <f:BoundField DataField="RealSendDate" SortField="RealSendDate" DataFormatString="{0:yyyy-MM-dd HH:mm}" HeaderText="配件出库时间" NullDisplayText="" Width="130px" />  
                        <f:WindowField ColumnID="changePartsSend" TextAlign="Center" Icon="SystemNew" ToolTip="品情处理进度"
                            WindowID="Window1" Title="品情处理进度" DataIFrameUrlFields="QltyId"  DataIFrameUrlFormatString="~/AgentSys/SvrMgr/ChangePartsSendDate.aspx?QltyId={0}"
                            Width="100px" HeaderText="品情处理进度"   />
                         <f:BoundField DataField="AgentAcceptDate" SortField="AgentAcceptDate" DataFormatString="{0:yyyy-MM-dd HH:mm}" HeaderText="索赔件到货时间" NullDisplayText="" Width="130px" /> 
                         <f:BoundField DataField="AgentRecoveryDate" SortField="AgentRecoveryDate" DataFormatString="{0:yyyy-MM-dd HH:mm}" HeaderText="故障排除时间" NullDisplayText="" Width="130px" /> 
                         <f:BoundField DataField="PartsInDate" SortField="PartsInDate" DataFormatString="{0:yyyy-MM-dd HH:mm}" HeaderText="旧件返回时间" NullDisplayText="" Width="130px" />  
                         <f:TemplateField HeaderText="IHISCE服务部对策与结果"    Width="200px" >
                            <ItemTemplate>
                                <asp:Label ID="lbSvrResult" runat="server"></asp:Label>
                            </ItemTemplate>
                        </f:TemplateField>
                        <f:LinkButtonField ColumnID="deleteField" TextAlign="Center" Icon="Delete" ToolTip="删除" ConfirmText="确定删除此记录？" ConfirmTarget="Self" CommandName="Delete" Width="50px" HeaderText="删除"/>                                       
                          <f:BoundField DataField="AgentSvrRealName"  SortField="AgentSvrRealName" HeaderText="代理人担当" NullDisplayText="" Width="100px" />  
                         <f:BoundField DataField="AgentSvrTel"  SortField="AgentSvrTel" HeaderText="代理人电话" NullDisplayText="" Width="100px" />  
                        <f:TemplateField HeaderText="导出"  Width="70px" TextAlign="Center">
                            <ItemTemplate>
                                <asp:HyperLink ID="execlClaims" runat="server" NavigateUrl="" Text='导出' ></asp:HyperLink>
                            </ItemTemplate>
                        </f:TemplateField>  
                        <f:WindowField ColumnID="changeZLAssignRealName" TextAlign="Center"  ToolTip="质管指派担当"
                            WindowID="Window2" Title="质管指派担当" DataIFrameUrlFields="QltyId"  DataIFrameUrlFormatString="~/AgentSys/SvrMgr/ChangeZLAssign.aspx?QltyId={0}"
                            Width="200px" HeaderText="质管指派担当"   />
                        <f:WindowField ColumnID="changeZLSituationReport" TextAlign="Center"  
                            WindowID="Window2" Title="对策报告" DataIFrameUrlFields="QltyId"  DataIFrameUrlFormatString="~/AgentSys/SvrMgr/ChangeZLAssign.aspx?QltyId={0}"
                            Width="120px" HeaderText="质管对策报告"    />
                        <f:BoundField DataField="ZLRank"  SortField="ZLRank" HeaderText="故障等级" NullDisplayText="0" Width="80px" /> 
                        <f:TemplateField HeaderText="是否对策后再发"  Width="100px" SortField="ZLIsAfterSend">
                            <ItemTemplate>
                                <%# (Eval("ZLIsAfterSend") is DBNull)?" ":Convert.ToBoolean(Eval("ZLIsAfterSend"))?"是":"否" %>
                            </ItemTemplate>
                        </f:TemplateField>
                    </Columns>
                </f:Grid>
            </Items>
        </f:Panel>
        <f:Window ID="Window1" runat="server" IsModal="true" Hidden="true" Target="Self" EnableResize="true"
            EnableMaximize="true" EnableIFrame="true" IFrameUrl="about:blank" Width="850px"
            Height="550px" OnClose="Window1_Close">
        </f:Window>
         <f:Window ID="Window2" runat="server" IsModal="true" Hidden="true" Target="Self" EnableResize="true"
            EnableMaximize="true" EnableIFrame="true" IFrameUrl="about:blank" Width="250px"
            Height="300px" OnClose="Window1_Close">
        </f:Window>
    </form>
    <script type="text/javascript">
        var basePath = '<%= ResolveUrl("~/AgentSys/") %>';
        function openAgentQltySvrAct(QltyId, ClaimsNumber) {
            var rel = "AgentQltySvrActEdit" + ClaimsNumber;
            var url = "SvrMgr/AgentQltySvrActEdit.aspx?QltyId=" + QltyId;
            var title = '打开/处理[' + ClaimsNumber + ']品情';
            var options = { width: 850, height: 450, max: false, mask: true, maxable: false, minable: false, fresh: true, resizable: false, drawable: true };
            top.navTab.openTab(rel, url, { title: title, fresh: true, external: true });
            //return false;          
        }

        function openAgentQltySvrMgrEdit(QltyId, ClaimsNumber) {
            var rel = "AgentQltySvrMgrEdit" + ClaimsNumber;
            var url = "SvrMgr/AgentQltySvrMgrEdit.aspx?QltyId=" + QltyId;
            var title = '审核[' + ClaimsNumber + ']品情';
            var options = { width: 850, height: 450, max: false, mask: true, maxable: false, minable: false, fresh: true, resizable: false, drawable: true };
            top.navTab.openTab(rel, url, { title: title, fresh: true, external: true });
            return false;
            // parent.addExampleTab.apply(null, ['AgentQltySvrMgrEdit' + ClaimsNumber, basePath + 'SvrMgr/AgentQltySvrMgrEdit.aspx?QltyId=' + QltyId, '审核[' + ClaimsNumber + ']品情', '', true]);
        }

        function openExecl(QltyId)
        {
            var url = "<%=this.ExportExcelWebUrl%>" + "/AgentSys/AgentQltyExeclSing.aspx?id=" + QltyId;
            top.window.open(url, "");
        }
        function openBatchExecl()
        {
            var url = "<%=this.ExportExcelWebUrl%>" + "/AgentSys/AgentQltyBatchExecl.aspx?q=<%=HttpUtility.UrlEncode(GetSQLWhere())%>";   
            top.window.open(url, "");
        }
    </script>
</body>
</html>
